#include "i2ckeyboard.h"



uint16_t keyboard_shake_off(char A2A1A0) //多次读取
{
	uint16_t a = 0;
	a = read_i2c_io_16bit(A2A1A0);
	vTaskDelay(25 / portTICK_PERIOD_MS); //进行25ms的延时
	if (a == read_i2c_io_16bit(A2A1A0)) {
		return a;
	} else {
		return 0xFFFF; //根据空闲时的状态设定0xFFFF/0x0000
	}
}

uint16_t get_key_value(char A2A1A0) //单次读取
{
	static uint16_t a = 0;
	while (keyboard_shake_off(A2A1A0) == 0xFFFF) {
		a = read_i2c_io_16bit(A2A1A0);
	}
	return a;
}
